---@class BuffEffect22 : BaseBuffEffect
BuffEffect22 = ClientFight.CreateClass("BuffEffect22", ClientFight.BaseBuffEffect)
local t = BuffEffect22
t.BUFF_EFFECT_PARAMETERS_21_ = "BUFF_EFFECT_PARAMETERS_21_"
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...}
    local calcType = buff.buffBean.f_BuffEffectValue[1];
    local plus = buff.buffBean.f_BuffEffectValue[2];
    local calcValue = buff.buffBean.f_BuffEffectValue[3];
    local target = buff.target;
    local skill = buff.skill;
    local energy = 0;
    if calcType == 1 then
        energy = calcValue;
    elseif calcType == 2 then
        energy = calcRatio(target.energy, calcValue);
    end

    if (energy > 0) then
        local logEn = energy;
    if (plus == 1) then
        SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
                .. buff.modelId .. " 触发能量变化：" .. logEn);
        FighterManager.addEnergy(fight, target, skill.skill.skillBean.f_SkillID, skill.frame, energy, EnergyChangeReasonEnum.BUFF);
    
    else

        SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
                    .. buff.modelId .. " 触发能量变化：" .. (-logEn));
            FighterManager.addEnergy(fight, target, skill.skill.skillBean.f_SkillID, skill.frame, -energy, EnergyChangeReasonEnum.BUFF);
        end
        end
    return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
    end

    t.New()